#ifndef NETWORK_H_
#define NETWORK_H_

#include "uarch/types.h"
#include "uarch/module.h"

class Network;

class Network_interface : public Module
{
public:
    Network_interface (Network *my_net, ModuleID moduleID, const char *name);
    ~Network_interface ();

    Network *my_net;

    virtual void tick (void) =0;
    virtual void tock (void) =0;
};

class Network
{
public:
    Network (int num_connections, int nodes_per_interface, int first_id_offset);
    virtual ~Network ();

    int num_connections;
    int nodes_per_interface;

    /** NodeID range, inclusive*/
    int lower_range_id;
    int upper_range_id;

    virtual void tick (void) =0;
    virtual void tock (void) =0;

    virtual Network_interface *get_interface(int id) =0;
};

#endif /* NETWORK_H_ */
